﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;

namespace Caduceu.Estudos.DAL
{
    /// <summary>
    /// Classe base para todos os DAOs.
    /// DAO = Data Access Object
    /// </summary>
    public class DaoBase : IDisposable
    {
        protected bool disposed = false;
        protected ISession session = null;

        public DaoBase(DbSession dbSession)
        {
            this.session = dbSession.session;
        }

        #region IDisposable Members

        public void Dispose()
        {
            if (!this.disposed)
            {
                session.Dispose();
                this.disposed = true;
            }
        }

        #endregion
    }
}
